package com.example.helloword.mod;

//所有的枚举类型都是 Enum 类的子类
public enum Size {
    //这些都是Size类的实例.会调用Enum类型保存name属性
    SMALL("S") , MED("M") , LARGE("L") , EXTRA_LARGE("XL") ;
    private String abbreviation;
    private Size(String abbreviation) { this.abbreviation = abbreviation; }
    public String getAbbreviation() { return abbreviation; }

    public static void main(String[] args) {
        System.out.println(Size.SMALL.toString());
        Size small = Size.valueOf("SMALL");
        System.out.println(small);
        Size[] values = Size.values();
        System.out.println(values);
    }
}
